package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.Brand;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BrandDao {
    @Select("select * from brand order by `index`")
    List<Brand> query();

    @Select("select * from brand where brandId=#{brandId}")
    Brand queryById(String brandId);

    @Insert("insert into brand(brandId,brand,brandImageUrl,brandDesc,brandStory,`index`,insertTime,updateTime,`status`)" +
            " values(#{brandId},#{brand},#{brandImageUrl},#{brandDesc},#{brandStory},#{index},#{insertTime},#{updateTime},#{status})")
    int save(Brand brand);

    @Delete("delete from brand where brandId=#{brandId}")
    int delete(String brandId);
}
